<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Posting.Master" Inherits="System.Web.Mvc.ViewPage<mesoBoard.Data.Post>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <div class="bread_crumb left">
        <%= Html.BreadCrumbThreadLink(0, (int)ViewData["ThreadID"]) %>
    </div> 
    
    <fieldset>
        <legend><%= Html.ThemeImage("create_post.png") %> Post Reply</legend>
                    
            <% if(ViewData["Preview"] != null && (bool)ViewData["Preview"]){ %>
                <% Html.RenderPartial("PostPreview", Model) ;%>
            <%} %>
        
        <form action="" method="post" enctype="multipart/form-data">
            <dl class="form">
                <dt>
                    <label>Message</label>
                    <table class="smilies">
                        <% Html.RenderAction("GetSmilies", "Post", new { x = 4, z = 20 }); %>
                        <tr><th colspan="4">more smilies</th></tr>
                    </table>                    
                </dt>
                <dd>
                    
                    <%= Html.TextArea("Text", ViewData["QuotePostText"] != null ? ViewData["QuotePostText"] + (Model != null ? Model.Text : "") : Model != null ? Model.Text : "", new { @class = "posting bbcode" })%>
                    <%= Html.ValidationMessage("Text") %>
                </dd>
                
                <% mesoBoard.Web.Models.UserPermissions perms = (mesoBoard.Web.Models.UserPermissions)ViewData["UserPermissions"]; %>
                <% if(perms.Attachment > 1){ %>

                    <dt>Attachments</dt>
                    <dd>
                        <div id="UploadFields">
                        <input type="file" name="file1" /><br />
                        <input type="file" name="file2" /><br />
                        </div>
                        <div id="UploadStatus">
                        </div>
                        <br />
                        <button type="button" id="ExtraUpload">Upload More</button>
                        <%= Html.ValidationMessage("FileSize") %>
                        <%= Html.ValidationMessage("FileType") %>
                    </dd>
                <%} %>
                
                <dt>Post Options</dt>
                <dd>
                    <input type="checkbox" name="SubscribeToThread" id="SubscribeToThread" value="true"
                    <%= mbStuff.CurrentUser.UserProfile.AlwaysSubscribeToThread ? "checked" : ""  %> />
                    <label class="inline" for="SubscribeToThread">Subscribe to thread</label>
                    <br />
                    <input type="checkbox" name="UseSignature" id="UseSignature" value="true" 
                    <%= mbStuff.CurrentUser.UserProfile.AlwaysShowSignature ? "checked" : ""  %> />
                    <label class="inline" for="UseSignature">Use signature</label>
                </dd>
                        
                <dt>&nbsp;</dt>
                <dd>
                    <%= Html.Hidden("ThreadID") %>
                    <%= Html.SubmitButton("PostReply", "Post Reply") %>
                    <button type="submit" name="Preview" value="true">Preview Post</button>
                    <%= Html.AntiForgeryToken() %>
                    <%= Html.ValidationMessage("TimeBetweenPosts") %>
                </dd>
                
            </dl>
        </form>
        <% Html.RenderAction("ThreadReview", "Post", new { ThreadID = (int)ViewData["ThreadID"] }); %>
    </fieldset>

</asp:Content>

